
<style>

    /*#table > tr{*/
        /*padding: 10px;*/
        /*margin: 10px;*/
    /*}*/

    .sm-st {
        background: #fff;
        padding: 20px;
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        border-radius: 3px;
        margin-bottom: 20px;
        -webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
        box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
    }

    .sm-st-icon {
        width: 50px;
        height: 50px;
        display: inline-block;
        line-height: 50px;
        text-align: center;
        font-size: 30px;
        background: #eee;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
        float: left;
        margin-right: 10px;
        color: #fff;
    }

    .sm-st-icons {
        width: 100px;
        height: 100px;
        display: inline-block;
        /*line-height: 60px;*/
        text-align: center;
        font-size: 22px;
        /*background: #eee;*/
        /*background: #45cf95;*/
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
        float: left;
        margin-right: 10px;
        /*color: #fff;*/
        color: #0d0d0d;
        border:1px solid #93a1a1;;
    }

    .sm-st-info {
        font-size: 10px;
        padding-top: 12px;
    }

    .sm-st-info span {
        display: block;
        font-size: 16px;
        font-weight: 100;
    }

    .sm-st-infos {
        font-size: 10px;
        padding-top: 25px;
    }

    .sm-st-infos span {
        display: block;
        font-size: 20px;
        font-weight: 100;
    }

    .orange {
        background: #fa8564 !important;
    }

    .tar {
        background: #45cf95 !important;
    }

    .sm-st .green {
        background: #86ba41 !important;
    }

    .pink {
        background: #AC75F0 !important;
    }

    .yellow-b {
        background: #fdd752 !important;
    }

    .stat-elem {

        background-color: #fff;
        padding: 18px;
        border-radius: 40px;

    }

    .stat-info {
        text-align: center;
        background-color: #fff;
        border-radius: 5px;
        margin-top: -5px;
        padding: 8px;
        -webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
        box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
        font-style: italic;
    }

    .stat-icon {
        text-align: center;
        margin-bottom: 5px;
    }

    .st-red {
        background-color: #F05050;
    }

    .st-green {
        background-color: #27C24C;
    }

    .st-violet {
        background-color: #7266ba;
    }

    .st-blue {
        background-color: #23b7e5;
    }

    .stats .stat-icon {
        color: #28bb9c;
        display: inline-block;
        font-size: 26px;
        text-align: center;
        vertical-align: middle;
        width: 50px;
        float: left;
    }

    .stat {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }

    .stat .value {
        font-size: 20px;
        line-height: 24px;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 500;
    }

    .stat .name {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stat.lg .value {
        font-size: 26px;
        line-height: 28px;
    }

    .stat.lg .name {
        font-size: 16px;
    }

    .stat-col .progress {
        height: 2px;
    }

    .stat-col .progress-bar {
        line-height: 2px;
        height: 2px;
    }

    .item {
        padding: 30px 0;
    }


    #statistics .panel {
        min-height: 150px;
    }

    #statistics .panel h5 {
        font-size: 13px;
    }


</style>
<div class="panel panel-default panel-intro">
    <div class="col-md-4">
        <div class="box box-success">
            <!--<div class="panel-heading">-->
                <!--<h3>公告列表:</h3>-->
            <!--</div>-->
            <div class="panel-body">
                <table id="table" class="table table-striped">
                <!--<table id="table" >-->
                    <thead>
                    <tr>
                        <th width="15%"></th>
                        <th width="85%"></th>
                    </tr>
                    </thead>
                    <tbody>



                    {foreach $notice as $index=>$vo}
                    <tr>
                        <!--<td><span class="text-success"><i class="fa fa-circle"></i>已读</span></td>-->
                        {if condition="$vo.type == 2"}
                        <td id="{$vo.id}"><span class="label label-success">已读</span></td>
                        {else}
                        <td id="{$vo.id}"><span class="label label-danger">未读</span></td>
                        {/if}
                        <td><a href="javascript:;" class="searchit" name="{$vo.id}">{$vo.title}</a></td>
                    </tr>
                    {/foreach}
                    <tr>
                        <!--<td><span class="text-primary"><i class="fa fa-circle"></i>未读</span></td>-->
                        <!--<td><span class="label label-primary">未读</span></td>-->
                        <!--<td><a href="javascript:;" class="searchit" >查看更多</a></td>-->
                        <!--<td><a href="buy/index" class="searchit" >查看更多</a></td>-->
                        <!--<td><a href="/QjaGeuOTbZ.php/oa/notice/index"><span>查看更多</span></a></td>-->
                        <td><a href="/QjaGeuOTbZ.php/oa/relevance/index" class="btn btn-xs btn-warning btn-addtabs" title="查看更多" data-table-id="table" data-field-index="10" data-row-index="0" data-button-index="3">查看更多</a></td>
                    </tr>


                    </tbody>
                </table>
            </div>

        </div>
        <div class="box box-success">
            <div class="panel-heading">
                <h2>审批办公</h2>
            </div>
            <div class="panel-body">
                <div class="row">
                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="log/index" ><span class="sm-st-icon st-green"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>日志</span>

                            </div>
                        </div>
                    </div>

                    <div class="col-sm-1 col-xs-6">

                    </div>

                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="goods/index" ><span class="sm-st-icon st-violet"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>物品申请</span>

                            </div>
                        </div>
                    </div>

                    <div class="col-sm-1 col-xs-6">

                    </div>

                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="client/index" ><span class="sm-st-icon st-green"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>客户维护</span>

                            </div>
                        </div>
                    </div>


<!--                    <div class="col-sm-3 col-xs-6">-->
<!--                        <div class="sm-st clearfix">-->
<!--                            <a href="leave/index" ><span class="sm-st-icon st-violet"><i class="fa fa-align-left"></i></span></a>-->
<!--                            <div class="sm-st-info">-->
<!--                                <span>请假</span>-->

<!--                            </div>-->
<!--                        </div>-->
<!--                    </div>-->

                </div>

                <div class="row">
                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="evection/index" ><span class="sm-st-icon st-green"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>出差</span>

                            </div>
                        </div>
                    </div>

                    <div class="col-sm-1 col-xs-6">

                    </div>

                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="universal/index" ><span class="sm-st-icon st-violet"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>通用审批</span>

                            </div>
                        </div>
                    </div>

                    <div class="col-sm-1 col-xs-6">

                    </div>

                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="apply/index" ><span class="sm-st-icon st-green"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>报销</span>

                            </div>
                        </div>
                    </div>


<!--                    <div class="col-sm-3 col-xs-6">-->
<!--                        <div class="sm-st clearfix">-->
<!--                            <a href="purchase/index" ><span class="sm-st-icon st-violet"><i class="fa fa-align-left"></i></span></a>-->
<!--                            <div class="sm-st-info">-->
<!--                                <span>采购</span>-->

<!--                            </div>-->
<!--                        </div>-->
<!--                    </div>-->

                </div>

                <div class="row">
                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="payment/index" ><span class="sm-st-icon st-green"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>付款</span>

                            </div>
                        </div>
                    </div>

                    <div class="col-sm-1 col-xs-6">

                    </div>

                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="stamp/index" ><span class="sm-st-icon st-violet"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>用章申请</span>

                            </div>
                        </div>
                    </div>

                    <div class="col-sm-1 col-xs-6">

                    </div>

                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="buy/index" ><span class="sm-st-icon st-green"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>内购申请</span>

                            </div>
                        </div>
                    </div>


<!--                    <div class="col-sm-3 col-xs-6">-->
<!--                        <div class="sm-st clearfix">-->
<!--                            <a href="give/index" ><span class="sm-st-icon st-violet"><i class="fa fa-align-left"></i></span></a>-->
<!--                            <div class="sm-st-info">-->
<!--                                <span>赠送服务</span>-->

<!--                            </div>-->
<!--                        </div>-->
<!--                    </div>-->
                </div>


                <div class="row">
                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="leave/index" ><span class="sm-st-icon st-green"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>请假</span>

                            </div>
                        </div>
                    </div>

                    <div class="col-sm-1 col-xs-6">

                    </div>

                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="leave/index" ><span class="sm-st-icon st-violet"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>请假</span>

                            </div>
                        </div>
                    </div>

                    <div class="col-sm-1 col-xs-6">

                    </div>

                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <a href="purchase/index" ><span class="sm-st-icon st-green"><i class="fa fa-align-left"></i></span></a>
                            <div class="sm-st-info">
                                <span>采购</span>

                            </div>
                        </div>
                    </div>

                </div>


            </div>

            </div>

        </div>
    </div>
    <div class="col-md-8">
        <div class="box box-success">

            <div class="panel-heading">
                <h2 id="time"></h2>
            </div>

            <div style="border-top: 2px solid #93a1a1; padding-top: 10px; margin-right: 20px;margin-left: 15px;box-sizing: border-box">
                <!--<h3 class="title" style="color: red;padding-left:20px">评论:</h3>-->
            </div>

            <div class="panel-heading {:$auth->check('oa/my/show')?'':'hide'}">
                <h2>接诊提醒</h2>
            </div>

            <div class="panel-body {:$auth->check('oa/my/show')?'':'hide'}">
                <div class="row">
                    <div class="col-sm-2 col-xs-6">
                        <a href="/QjaGeuOTbZ.php/statistics/registration/index?status=待就诊&date={$times}" class="sm-st-icons">
                            <div class="sm-st-infos">
                            <span>{$today_registration}</span>
                            {:__('预约今天人数')}
                            </div>
                        </a>
                    </div>
                    <div class="col-sm-2 col-xs-6">
                        <a href="/QjaGeuOTbZ.php/statistics/registration/index?status=待就诊&date={$three}" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$three_registration}</span>
                                {:__('预约近3天人数')}
                            </div>
                        </a>
                    </div>
                    <div class="col-sm-2 col-xs-6">
                        <a href="/QjaGeuOTbZ.php/statistics/registration/index?status=待就诊&date={$seven}" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$seven_registration}</span>
                                {:__('预约近7天人数')}
                            </div>
                        </a>
                    </div>

                </div>

            </div>


            <div class="panel-body">
                <div class="row">
                    <div class="panel-heading" style="display: flex;">
                        <h2 class="col-sm-6 col-xs-6 {:$auth->check('oa/my/shows')?'':'hide'}">财务提醒</h2>
                        <h2 class="col-sm-6 col-xs-6 {:$auth->check('oa/my/show')?'':'hide'}" style="display: flex;flex-direction: column;">药品提醒</h2>
                    </div>
                    <div class="col-sm-2 col-xs-6 {:$auth->check('oa/my/shows')?'':'hide'}">
                        <a href="/QjaGeuOTbZ.php/financing/supplementary/index?on_credit=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$arrearage}</span>
                                {:__('未补交欠款')}
                            </div>
                        </a>
                    </div>
                    <div class="col-sm-2 col-xs-6 {:$auth->check('oa/my/shows')?'':'hide'}">
                        <a href="/QjaGeuOTbZ.php/financing/order/index?entry=0" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$cost}</span>
                                {:__('诊疗销售费用待录入')}
                            </div>
                        </a>
                    </div>

                    <div class="col-sm-2 col-xs-6 {:$auth->check('oa/my/show')?'':'hide'}">

                    </div>

                    <div class="col-sm-2 col-xs-6 {:$auth->check('oa/my/show')?'':'hide'}">
                        <a href="/QjaGeuOTbZ.php/medicine/storage/index?date={$end_time}" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$past}</span>
                                {:__('过期提醒')}
                            </div>
                        </a>
                    </div>
                    <div class="col-sm-2 col-xs-6 {:$auth->check('oa/my/show')?'':'hide'}">
                        <a href="/QjaGeuOTbZ.php/medicine/storage/index?status=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$count}</span>
                                {:__('库存预警')}
                            </div>
                        </a>
                    </div>

                </div>

            </div>

            <div class="panel-heading {:$auth->check('oa/my/oa')?'':'hide'}">
                <h2>OA待处理</h2>
            </div>


            <div class="panel-body {:$auth->check('oa/my/oa')?'':'hide'}">
                <div class="row">
                    <div class="col-sm-2 col-xs-6">
                        <a href="log/index?is=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$log}</span>
                                {:__('日志')}
                            </div>
                        </a>
                    </div>
                    <div class="col-sm-2 col-xs-6">
                        <!--<a href="goods/index?is=1&is_comment=0" class="sm-st-icons">-->
                        <a href="goods/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$goods}</span>
                                {:__('物品申请')}
                            </div>
                        </a>
                    </div>
                    <div class="col-sm-2 col-xs-6">
                        <a href="leave/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$leave}</span>
                                {:__('请假')}
                            </div>
                        </a>
                    </div>

                    <div class="col-sm-2 col-xs-6">
                        <a href="evection/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$evection}</span>
                                {:__('出差')}
                            </div>
                        </a>
                    </div>

                    <div class="col-sm-2 col-xs-6">
                        <a href="universal/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$universal}</span>
                                {:__('通用审批')}
                            </div>
                        </a>
                    </div>

                    <div class="col-sm-2 col-xs-6">
                        <a href="client/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$client}</span>
                                {:__('客户维护')}
                            </div>
                        </a>
                    </div>

                </div>

            </div>

            <div class="panel-body {:$auth->check('oa/my/oa')?'':'hide'}">
                <div class="row">
                    <div class="col-sm-2 col-xs-6">
                        <a href="apply/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$apply}</span>
                                {:__('报销')}
                            </div>
                        </a>
                    </div>
                    <div class="col-sm-2 col-xs-6">
                        <a href="purchase/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$purchase}</span>
                                {:__('采购')}
                            </div>
                        </a>
                    </div>
                    <div class="col-sm-2 col-xs-6">
                        <a href="payment/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$payment}</span>
                                {:__('付款')}
                            </div>
                        </a>
                    </div>

                    <div class="col-sm-2 col-xs-6">
                        <a href="buy/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$buy}</span>
                                {:__('员工内购申请')}
                            </div>
                        </a>
                    </div>

                    <div class="col-sm-2 col-xs-6">
                        <a href="give/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$give}</span>
                                {:__('赠送服务申请')}
                            </div>
                        </a>
                    </div>

                    <div class="col-sm-2 col-xs-6">
                        <a href="stamp/index?is=1&is_comment=1" class="sm-st-icons">
                            <div class="sm-st-infos">
                                <span>{$stamp}</span>
                                {:__('用章申请')}
                            </div>
                        </a>
                    </div>

                </div>

            </div>


        </div>


    </div>
</div>
<script src="/assets/img/jquery-3.4.1.min.js"></script>
<script>
    $(".searchit").click(function(){
        let id = $(this).attr("name");

        $.ajax({
            url:"oa/relevance/fors",    //请求的url地址
            dataType:"json",   //返回格式为json
            async:true,//请求是否异步，默认为异步，这也是ajax重要特性
            data:{"id":id},    //参数值
            type:"POST",   //请求方式
            success:function(data){
                //console.log(data);
                //请求成功时处理
                if (data.code == 0) {
                    Toastr.error(data.msg);
                }else {
                    let ids = data.data;
                    let idss = '#'+data.data;
                    let urls = 'oa/relevance/detail?id='+ids;

                    $(idss).html('<span class="label label-success">已读</span>');

                    //Fast.api.open(urls, __('详情'), {area:['65%', '90%']});
                    Fast.api.open(urls, __('详情'), []);
                }
            },
        });

    });

    function datetime() {
        //创建日期时间对象
        var datetime = new Date();

        //获取组件
        var year = datetime.getFullYear();
        var month = datetime.getMonth() + 1;
        var day = datetime.getDate();
        var hour = datetime.getHours();
        var minute = datetime.getMinutes();
        var second = datetime.getSeconds();
        var week = datetime.getDay();

        //转换星期格式
        switch (week) {
            case 0:
                var week = '星期日';
                break;
            case 1:
                var week = '星期一';
                break;
            case 2:
                var week = '星期二';
                break;
            case 3:
                var week = '星期三';
                break;
            case 4:
                var week = '星期四';
                break;
            case 5:
                var week = '星期五';
                break;
            case 6:
                var week = '星期六';
                break;
        }

        //小时,分钟,秒如果小于10加上前导零
        if (hour < 10) {
            var hour = 0 + "" + hour;
        }

        if (minute < 10) {
            var minute = 0 + "" + minute;
        }

        if (second < 10) {
            var second = 0 + "" + second;
        }

        //完整时间
        var now =  year + "年" + month + "月" + day + "日" + " " + hour + ":" + minute + ":" + second + " " + week;

        //更新内容
        $("#time").text(now);//这里是往p标签中添加
    }

    //定时器
    setInterval(datetime, 1000);

</script>